package com.souku.finance.application.ui.more;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.souku.finance.application.R;
import com.souku.finance.application.adapter.BanklistAdapter;
import com.souku.finance.application.base.BaseActivity;
import com.souku.finance.application.ui.mine.BindCardActivity;

/**
 * Created by Android on 2016/12/25.
 */

public class BankListActivity extends BaseActivity implements View.OnClickListener {

    protected RelativeLayout topBack;
    protected TextView topTitle;
    protected PullToRefreshListView pullList;

    @Override
    public void internet() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.act_banklist);
        initView();
        topTitle.setText("选择银行卡");
        pullList.setAdapter(new BanklistAdapter());
        pullList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(BankListActivity.this, BindCardActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.top_back) {
            finish();
        }
    }

    private void initView() {
        topBack = (RelativeLayout) findViewById(R.id.top_back);
        topBack.setOnClickListener(BankListActivity.this);
        topTitle = (TextView) findViewById(R.id.top_title);
        pullList = (PullToRefreshListView) findViewById(R.id.pull_list);
    }
}
